Optimal. Leaf size=71 \[ -\frac {b d n}{4 x^2}-\frac {b e n x^{-2+r}}{(2-r)^2}-\frac {d \left (a+b \log \left (c x^n\right )\right )}{2 x^2}-\frac {e x^{-2+r} \left (a+b \log \left (c x^n\right )\right )}{2-r} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {14, 2372}
\begin {gather*} -\frac {d \left (a+b \log \left (c x^n\right )\right )}{2 x^2}-\frac {e x^{r-2} \left (a+b \log \left (c x^n\right )\right )}{2-r}-\frac {b d n}{4 x^2}-\frac {b e n x^{r-2}}{(2-r)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 2372
Rubi steps
\begin {align*} \int \frac {\left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right )}{x^3} \, dx &=-\frac {1}{2} \left (\frac {d}{x^2}+\frac {2 e x^{-2+r}}{2-r}\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \left (-\frac {d}{2 x^3}+\frac {e x^{-3+r}}{-2+r}\right ) \, dx\\ &=-\frac {b d n}{4 x^2}-\frac {b e n x^{-2+r}}{(2-r)^2}-\frac {1}{2} \left (\frac {d}{x^2}+\frac {2 e x^{-2+r}}{2-r}\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 72, normalized size = 1.01 \begin {gather*} -\frac {2 a (-2+r) \left (d (-2+r)-2 e x^r\right )+b n \left (d (-2+r)^2+4 e x^r\right )+2 b (-2+r) \left (d (-2+r)-2 e x^r\right ) \log \left (c x^n\right )}{4 (-2+r)^2 x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.10, size = 613, normalized size = 8.63
method | result | size |
risch | \(-\frac {b \left (d r -2 e \,x^{r}-2 d \right ) \ln \left (x^{n}\right )}{2 \left (-2+r \right ) x^{2}}-\frac {8 x^{r} a e +4 b d n +4 x^{r} b e n -4 x^{r} a e r +8 a d -4 b d n r -8 \ln \left (c \right ) b d r +2 \ln \left (c \right ) b d \,r^{2}+2 a d \,r^{2}+8 d b \ln \left (c \right )-4 \ln \left (c \right ) b e \,x^{r} r -8 a d r +i \pi b d \,r^{2} \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+4 i \pi b e \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} x^{r}+4 i \pi b e \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} x^{r}+i \pi b d \,r^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}-4 i \pi b d \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} r -4 i \pi b d \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} r -4 i \pi b d \mathrm {csgn}\left (i c \,x^{n}\right )^{3}+b d n \,r^{2}-4 i \pi b e \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) x^{r}-2 i \pi b e \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} x^{r} r -2 i \pi b e \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} x^{r} r -i \pi b d \,r^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )+4 i \pi b d \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) r +8 \ln \left (c \right ) b e \,x^{r}+2 i \pi b e \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) x^{r} r +4 i \pi b d \mathrm {csgn}\left (i c \,x^{n}\right )^{3} r -i \pi b d \,r^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{3}-4 i \pi b e \mathrm {csgn}\left (i c \,x^{n}\right )^{3} x^{r}-4 i \pi b d \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )+4 i \pi b d \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+4 i \pi b d \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+2 i \pi b e \mathrm {csgn}\left (i c \,x^{n}\right )^{3} x^{r} r}{4 \left (-2+r \right )^{2} x^{2}}\) | \(613\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 140 vs.
\(2 (64) = 128\).
time = 0.37, size = 140, normalized size = 1.97 \begin {gather*} -\frac {4 \, b d n + {\left (b d n + 2 \, a d\right )} r^{2} + 8 \, a d - 4 \, {\left (b d n + 2 \, a d\right )} r - 4 \, {\left ({\left (b r - 2 \, b\right )} e \log \left (c\right ) + {\left (b n r - 2 \, b n\right )} e \log \left (x\right ) - {\left (b n - a r + 2 \, a\right )} e\right )} x^{r} + 2 \, {\left (b d r^{2} - 4 \, b d r + 4 \, b d\right )} \log \left (c\right ) + 2 \, {\left (b d n r^{2} - 4 \, b d n r + 4 \, b d n\right )} \log \left (x\right )}{4 \, {\left (r^{2} - 4 \, r + 4\right )} x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 495 vs.
\(2 (63) = 126\).
time = 3.45, size = 495, normalized size = 6.97 \begin {gather*} \begin {cases} - \frac {2 a d r^{2}}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} + \frac {8 a d r}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} - \frac {8 a d}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} + \frac {4 a e r x^{r}}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} - \frac {8 a e x^{r}}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} - \frac {b d n r^{2}}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} + \frac {4 b d n r}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} - \frac {4 b d n}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} - \frac {2 b d r^{2} \log {\left (c x^{n} \right )}}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} + \frac {8 b d r \log {\left (c x^{n} \right )}}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} - \frac {8 b d \log {\left (c x^{n} \right )}}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} - \frac {4 b e n x^{r}}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} + \frac {4 b e r x^{r} \log {\left (c x^{n} \right )}}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} - \frac {8 b e x^{r} \log {\left (c x^{n} \right )}}{4 r^{2} x^{2} - 16 r x^{2} + 16 x^{2}} & \text {for}\: r \neq 2 \\- \frac {a d}{2 x^{2}} + a e \log {\left (x \right )} + b d \left (- \frac {n}{4 x^{2}} - \frac {\log {\left (c x^{n} \right )}}{2 x^{2}}\right ) - b e \left (\begin {cases} - \log {\left (c \right )} \log {\left (x \right )} & \text {for}\: n = 0 \\- \frac {\log {\left (c x^{n} \right )}^{2}}{2 n} & \text {otherwise} \end {cases}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 396 vs.
\(2 (64) = 128\).
time = 4.32, size = 396, normalized size = 5.58 \begin {gather*} -\frac {b d n r^{2} \log \left (x\right )}{2 \, {\left (r^{2} - 4 \, r + 4\right )} x^{2}} + \frac {b n r x^{r} e \log \left (x\right )}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} - \frac {b d n r^{2}}{4 \, {\left (r^{2} - 4 \, r + 4\right )} x^{2}} - \frac {b d r^{2} \log \left (c\right )}{2 \, {\left (r^{2} - 4 \, r + 4\right )} x^{2}} + \frac {b r x^{r} e \log \left (c\right )}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} + \frac {2 \, b d n r \log \left (x\right )}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} - \frac {2 \, b n x^{r} e \log \left (x\right )}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} + \frac {b d n r}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} - \frac {a d r^{2}}{2 \, {\left (r^{2} - 4 \, r + 4\right )} x^{2}} - \frac {b n x^{r} e}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} + \frac {a r x^{r} e}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} + \frac {2 \, b d r \log \left (c\right )}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} - \frac {2 \, b x^{r} e \log \left (c\right )}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} - \frac {2 \, b d n \log \left (x\right )}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} - \frac {b d n}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} + \frac {2 \, a d r}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} - \frac {2 \, a x^{r} e}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} - \frac {2 \, b d \log \left (c\right )}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} - \frac {2 \, a d}{{\left (r^{2} - 4 \, r + 4\right )} x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\left (d+e\,x^r\right )\,\left (a+b\,\ln \left (c\,x^n\right )\right )}{x^3} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________